
function container(container,_stary, _endy, loadFlag, page, general, type,loadmore) {
    console.log(general);
    loadGeneral(page.value, general, type);
    $(container).on("touchend", function () {
        console.log($(this));
        $(container).stop().animate({top: 0}, 80);
        if ($(this).height() + $(this).scrollTop() >= $(container+" ul").height() && !loadFlag) {
            loadFlag = true;
            $(loadmore).addClass("show");
            $(this).scrollTop(100000000000);
            page.value = page.value + 1;
            loadGeneral(page.value, general, type);
            setTimeout(function () {
                $(loadmore).removeClass("show");
                loadFlag = false;
            }, 1000);
        }
    });
    $(container).on("touchstart", function (e) {
        console.log($(this));
        var _touch = e.originalEvent.targetTouches[0];
        _stary = _touch.pageY;
    });
    $(container).on("touchmove", function (e) {
        console.log($(this));
        var _touch = e.originalEvent.targetTouches[0];
        _endy = _touch.pageY;
        if ($(this).height() + $(this).scrollTop() >= $(container+" ul").height()) {
            var current_y = _endy - _stary;
            $(container).animate({top: current_y / 3}, 5);
        }
    });
}

var myScroll, pullDownEl, pullDownOffset, pullUpEl, pullUpOffset, generatedCount = 0;

function loadGeneral(page, general, typeId) {
    $.ajax({
        type: "post",//访问url类型（get,post）
        url: url,//url地址
        async: true,//是否异步加载，true为异步加载，false为同步加载
        data: {
            typeId: typeId,
            page: page,

        },//发送数据
        dataType: "text",//数据类型
        success: function (result) {//成功返回
            result = eval("(" + result + ")");
            console.log(result);
            var html;
            for (var i = 0; i < result.length; i++) {
                var readYOS="";
                if(result[i][5]!=null){
                    readYOS="已读";
                }
                if(result[i][4]!=null){
                    total=result[i][4];
                }
                var li = document.createElement("li");
                li.className = "teamDetail";
                li.innerHTML = "0" +
                    "<a href='/getStudyDetail?id=" + result[i][0] + "' " +
                        "<div class='am-g'>" +
                            "<div class='am-u-sm-10'>" +
                                "<div class='title'>" + result[i][1] + "" +
                                    "<p class='detail'>"+result[i][2]+"&nbsp;&nbsp;&nbsp;阅读数："+total+"</p>" +
                                "</div>" +
                            "</div>" +
                            "<div class='am-u-sm-2'>" +
                                "<img src='" + result[i][3] + "' style='height: 50px;width:50px' class='titleImg'/>" +readYOS+
                            "</div>" +
                        "</div>"+
                    "<hr>"+
                    "</a>";
                general.appendChild(li);
            }
        },
        error: function (errorMsg) {//返回失败
            console.log(errorMsg);
        }
    });
}

